/**
 * create by young (young2f@outlook.com) on 2023/5/21
 */
'use strict';

const _deviceMqtt = require('./interface/mqttCli');
const _init = require('./core/init');
const _tcpSer = require('./interface/tcpSer');
module.exports = class {
  constructor(app) {
    this.app = app;
  }

  async restart() {

    this.app.init = new _init(this.app);
    await this.app.init.suInit();
    // await this.app.init.initTenantFinanceTree();
    await this.app.init.initTenantPersonnelDicTree();

    // // this.app.ruleEngineMgr = new ruleEngine(this.app);
    // this.app.iiot = new iiot(this.app);
    //
    // return this.app.iiot.restart();

    console.info('app is start');

    //
    // /**
    //  * 设备管理
    //  */
    // if (!this.app.deviceMgr) {
    //   console.log('部署CJ deviceMgr');
    //   this.app.deviceMgr = new _deviceMgr(this.app);
    // }
    // await this.app.deviceMgr.init();
  }
};
